const joi = require('@hapi/joi')

//定义用户名和密码的验证规则
const username = joi.string().alphanum().min(1).max(10).required()
const password = joi.string().pattern(/^[\S]{6,12}$/).required
// 定义验证avator 头像的验证规则
const avatar = joi.string().dataUri().required()

// 定义注册和登陆表单的验证规则
exports.reg_login_schema = {
    body: {
        username,
        password
    }
}
// 定义头像验证队则
exports.update_avatar_schema = {
    body: {
        avatar
    }
}